<?php

	class Wp_ship_plan_model extends CI_Model {

		protected $__tbname = 'wp_ship_plan';
		protected $__dbconf = 'default';

		var $id;	//int(10) unsigned	Primary Key	Auto Increment	NOT NULL
		var $id_wp_country;	//int(10) unsigned			NOT NULL
		var $ship_name;	//varchar(255)			NOT NULL
		var $draf;	//double(10,2) unsigned			NOT NULL
		var $loa;	//double(10,2) unsigned			NOT NULL
		var $dwt = 0;	//int(10) unsigned			NULL
		var $other_ship;	//text			NULL
		var $date_time;	//datetime			NULL
		var $from;	//text			NULL
		var $to;	//text			NULL
		var $advertiser;	//text			NULL
		var $id_wp_purposes = 0;	//int(10)			NULL
		var $goods;	//text			NULL
		var $created_date = CURRENT_TIMESTAMP;	//timestamp			NOT NULL
		var $modified_date;	//datetime			NULL

		protected $__validation_rule = array(
			'id' => array('key' => 'PRI', 'type' => 'int', 'null' => FALSE, 'auto_increment' => TRUE),
			'id_wp_country' => array('type' => 'int', 'null' => FALSE),
			'ship_name' => array('type' => 'varchar', 'size' => 255, 'null' => FALSE),
			'draf' => array('type' => 'double', 'null' => FALSE),
			'loa' => array('type' => 'double', 'null' => FALSE),
			'dwt' => array('type' => 'int', 'null' => TRUE),
			'other_ship' => array('type' => 'text', 'null' => TRUE),
			'date_time' => array('type' => 'datetime', 'null' => TRUE),
			'from' => array('type' => 'text', 'null' => TRUE),
			'to' => array('type' => 'text', 'null' => TRUE),
			'advertiser' => array('type' => 'text', 'null' => TRUE),
			'id_wp_purposes' => array('type' => 'int', 'null' => TRUE),
			'goods' => array('type' => 'text', 'null' => TRUE),
			'created_date' => array('type' => 'timestamp', 'null' => FALSE),
			'modified_date' => array('type' => 'datetime', 'null' => TRUE)
		);

		protected $__relation = array(
			array('table' => 'wp_country', 'foreign_key' => 'id_wp_country'),
			array('table' => 'wp_purposes', 'foreign_key' => 'id_wp_purposes')
		);
	}
